Digital speed determination in ultrasonic flow measurements

ABSTRACT

A method and device ( 60 ) is described which measures the speed of a flowing fluid (F) by measuring the difference in time taken for an ultrasonic signal to travel first upstream and then downstream in the fluid. In each direction the device ( 60 ) calculates the time taken for an ultrasonic wave packet emitted by one ultrasonic transducer ( 62 ) to be received by another ( 63 ). The method used consists of the digitisation ( 85 ) of the received waveform and the subsequent identification of waveform features by comparison with a standard template of the waveform. The position in time of these features is then determined with respect to a high speed clock ( 70 ). The results are then used in a weighted computation to determine the time of arrival of the waveform at the transducer ( 63 ).

FIELD OF THE INVENTION

The present invention relates to a device for measuring the flow speedof a moving fluid and which utilizes ultrasonics and digital speeddetermination.

DESCRIPTION OF THE RELATED ART

The measurement of the difference in propagation time for the upstreamand downstream travel of an ultrasonic signal in a moving fluid is anestablished method used to measure the rate of flow of that fluid. Theultrasonic signal used for such purposes typically consists of a wavepacket of sinusoidal shape with peaks of differing amplitudes. Anexample of such a wave packet is depicted in FIG. 3 which shows anelectronically received ultrasonic signal 40. The problem of accuratelydetermining the time of arrival of such a signal is generally consideredto involve two specific criteria.

The first is the unique identification of a particular part of thereceived signal 40 that can be used as a timing reference. The partusually chosen is a point at which one cycle of the wave crosses thesignal axis 42, a so-called “zero crossing”. The identification of aparticular zero crossing is conventionally done with reference to themagnitude of the largest peak 41 in the received signal 40. This methodhas several difficulties. The first is that the size of the largest peak41 can vary considerably, and is dependent on the conditions under whichthe signal is being transmitted. For example, if ultrasonic transducersbased upon piezoelectric materials such as PVDF are being used, the sizeof the peak 41 can change by a factor of 30 as the fluid temperaturechanges from +60 to −20° C. Even more importantly, for a wave packet ina tube, the particular cycle of the received signal 40 where the largestpeak 41 occurs often changes, and is dependent on conditions such astemperature and frequency. This is largely because the maximum of such asignal often, but not always, occurs where secondary acoustic modes makeup a major part of the received signal 40. Generally depicted at 43 inFIG. 3 is an example of the influence of secondary and other high orderacoustic modes These secondary modes are much more affected bytemperature and frequency than is the plane wave (primary mode). Thecondition where two peaks within the wavepacket are identical inmagnitude is one which the zero-crossing method finds particularlydifficult to accommodate.

The second criterion is the identification of the arrival time of theidentified zero-crossing, which is generally the zero-crossing 44immediately after the largest peak 41, is received at the signaldetector with respect to the time scale being used. The accuracy of thetiming of the arrival of the wave is usually limited to one clock pulse,this time interval therefore represents the uncertainty of themeasurement.

International Patent Publication No. WO 93/00569 entitled “An ElectronicFluid Flow Meter” discloses an acoustic wave packet detectionarrangement and associated flow measuring apparatus that embodies onesolution to the above problems. Such an arrangement utilizes envelopedetection and an arming method for zero-crossing detection.International Patent Publication Nos. WO 93/00570 and WO 94/20821 eachdisclose different methods for lessening the propagation of high orderacoustic modes which, as discussed above, can contribute significantlyto the received wave packet and thus cause timing errors. U.S. Pat. No.5,206,836 discloses a digital arrangement for determining, based onlinear regression about a single zero-crossing, the arrival of a wavepacket.

SUMMARY OF THE INVENTION

It is an object of the present invention to provide a measurement deviceand method for ultrasonic timing which permits both the uniqueidentification of a part of an ultrasonic signal and the timing of thearrival of that part of the signal at a detector.

In accordance with a first aspect of the present invention there isdisclosed a method of detecting an arrival time at a transducer of anacoustic wave packet transmitted at a predetermined frequency, saidmethod comprising the steps of:

(a) transmitting an acoustic wave packet at a predetermined frequency;

(b) detecting at a transducer the acoustic wave packet and producing ananalogue signal output;

(c) converting, at a sampling frequency, the analogue signal output fromsaid transducer into digital signal data having consequential spacing;

(d) determining a measurement portion of said digital signal data, saidmeasurement portion corresponding to a response of said transducer tosaid acoustic wave packet;

(e) determining from said measurement portion a plurality of slopesS_(i) for a corresponding plurality i, where i is an integer betweenzero and 20, of measurement segments of said response, each of saidsegments being about a signal level value V; and

(f) determining from at least selected ones of said slopes S_(i), anarrival time t of said acoustic wave packet.

Generally, the method comprises the further step, between steps (e) and(f) of:

(ea) determining, for selected ones of said segments, a correspondingmeasurement time A_(i) indicative of a time at which said responseintercepts said signal level value V;

wherein step (f) comprises determining said arrival time t from saidcorresponding measurement times A_(i).

Preferably, a further step is provided, between steps (e) and (ea) of:

(eaa) matching said slopes S_(i) with a corresponding reference set ofslopes P_(j) to determine a measurement position of each of saidsegments in said measurement portion;

wherein step (ea) comprises determining said corresponding measurementtimes A_(i) from the corresponding one of said measurement positions.

Generally, step (e) comprises allocating a set of points including aninteger k number of points of said digital signal data to each saidmeasurement segment i, each said measurement segment i being centeredaround two adjacent points, each of the two adjacent points having avalue which lies on alternative sides of said signal level value V,fitting a straight line to each set of points, and then determining theslope S_(i) of each said straight line. Advantageously, the straightline comprises a line joining the two adjacent points. Preferably thevalue of k is related to a ratio of the sampling frequency to saidpredetermined frequency at which said acoustic wave packet istransmitted, and to the consequential spacing of said digital signaldata in said measurement portion. Typically, k is equal to one eighth ofthe number of points per cycle. Most preferably, the value of k is 10.

In one advantageous arrangement, each slope P_(j) of said reference setof slopes is associated with a specific position parameter n, saidspecific position parameter n marking a position corresponding to asignal polarity transition within said wave packet, wherein eachspecific position parameter n, corresponds to an integral number ofhalf-wave periods of said wave packet between a beginning of said wavepacket corresponding to the arrival time of the wave packet and thecorresponding signal polarity transition within said wave packet.

In a preferred implementation, step (f) comprises the followingsub-steps:

(fa) assigning a weighting factor W_(i) to each of said measurementtimes A_(i) based upon the corresponding position parameter n;

(fb) selecting a number m of said measurement times A_(i) for using inthe determination of the arrival time t;

(fc) determining a mean half-wave period τ from time intervals betweenadjacent ones of said number m of selected measurement times A_(i);

(fd) determining, for each of the number m of selected measurement timesA_(i), an estimated arrival time t_(i) of said wave packet at thetransducer;

(fe) determining a sum, over the number m of measurement times A_(i), ofa product of the weighting factor W_(i) assigned to each of saidmeasurement times and the corresponding estimated arrival time t_(i);and

(ff) determining the arrival time t of said acoustic wave packet bydividing the sum determined in step (fe) by a sum of each weightingfactor W_(i) assigned to each of the number m of measurement times.

Generally, each weighting factor W_(i), is proportional to the slopeS_(i), of the corresponding one of said segments. Typically, m can takea value from 2 to 20. A preferred value of m is 6.

Advantageously, step (fd) comprises determining the estimated arrivaltime t_(i) using the expression t_(i)=A_(i)−n·τ, wherein A_(i) are themeasurement times, n is the corresponding position parameter, and τ isthe mean half-wave period.

In the preferred embodiment, the sampling frequency is used to generatesaid acoustic wave packet and preferably said predetermined frequency atwhich said acoustic wave packet is transmitted is a sub-multiple of saidsampling frequency.

Generally the signal level value is derived from averaging that digitalsignal data received in advance of the measurement portion. Also, step(a) typically comprises the continuous conversion of the signal.

In accordance with a second aspect of the present invention there isdisclosed a method of determining the propagation time of an acousticwave packet transmitted between two ultrasonic transducers, said methodcomprising the steps of:

(g) starting a clock operating at a clock operating [predetermined]frequency;

(h) simultaneously with a transition of said clock, the steps of:

(ha) energizing a first one of two transducers to output an acousticwave packet at an energizing frequency which is lower than said clockoperating frequency, and

(hb) maintaining said clock as a timing reference for subsequentdetection of an arrival of said wave packet at a second one of twotransducers;

(i) detecting an arrival time of said wave packet using the method ofthe first aspect, wherein said sampling frequency is said clockoperating frequency and is provided by said clock, and said digitalsignal data including said measurement portion is stored in a memoryhaving an address determination for consecutive samples of said digitalsignal data being altered by said clock such that each address in saidmemory corresponds to an identifiable time which is identifiable aftergeneration of said acoustic wave packet.

Generally, a plurality of the acoustic wave packets are transmitted and,excepting the first transmission, the transmission of all subsequentacoustic wave packets are synchronized to the reception of theimmediately preceding acoustic wave packet. Typically, upon transmissionof a particular acoustic wave packet a delay time is counted and thetransmission of the next acoustic wave packet is instituted after thedelay time has elapsed and when the measurement portion corresponding tothe particular acoustic wave packet next crosses the signal level value.

In an alternative configuration an acoustic wave packet is transmittedsimultaneously from each of the transducers for reception by the otherof the transducers and the propagation time of each of the acoustic wavepackets is thus determined. Typically, in such an arrangement step (a)further comprises compensating for phase differences between the digitalsignal data converted from analogue signals output from respective onesof the transducers.

In accordance with a third aspect of the present invention there isdisclosed a system for measuring a speed of a moving fluid, said systemcomprising:

a measurement tube through which the fluid passes;

two ultrasonic transducers disposed in said tube and configured fortransmitting ultrasonic signals between each other;

exciting means for exciting at least a first one of said transducers togenerate an acoustic wave packet that propagates at a predeterminedfrequency along said tube toward a second one of said transducers;

detecting means connected to at least said second one of saidtransducers for detecting the acoustic wave packet,

converting means for converting at a sampling frequency an analoguesignal output from at least said second one of said transducers todigital signal data,

a first storage means for storing said digital signal data from saidconverting means;

processor means connected to said first storage means for determiningthe speed of the fluid, said processor means comprising:

first determining means for determining a measurement portion of saiddigital signal data, said measurement portion corresponding to aresponse of said second one of said transducers to said acoustic wavepacket;

second determining means for determining from said measurement portion aplurality of slopes S_(i) for a corresponding plurality i of measurementsegments of said response, each of said segments being about a signallevel value V;

third determining means for determining from at least selected ones ofsaid slopes S_(i), an arrival time t of said acoustic wave packet.

Typically, the system further comprises fourth determining means fordetermining, for selected ones of said segments, a correspondingmeasurement time A_(i) indicative of a time at which said responseintercepts the signal level value, wherein the third determining meansdetermines said arrival time t from said corresponding measurement timesA_(i).

Preferably, the system further comprises a second storage meansconnected to said processor means for storing a reference signal, saidprocessor means including fifth determining means arranged to matchparts of said reference signal with the measurement portion to determinea measurement position of each of the segments in the measurementportion, wherein said measurement times A_(i) are determined using acorresponding one of said measurement positions.

Advantageously, the system further comprises adjusting means, coupled toat least said second one of said transducers, for adjusting themagnitude of said analogue signal from at least said second on of saidtransducers to fall between certain limits, said certain limitspreferably being equally displaced either side of the signal levelvalue, said signal level value preferably being an average of an outputof the second transducer before said measurement portion.

Typically, in any of the aspects, the sampling frequency is between 500kHz and 10 GHz. Preferably the sampling frequency is 10 MHz.

Generally, in any of the aspects, the predetermined frequency is between20 kHz and 5 MHz. Most preferably the predetermined frequency is 125kHz.

In accordance with one broad aspect of the present invention, there isdisclosed a method of detecting the arrival time at a transducer of anacoustic wave packet transmitted at a predetermined frequency, themethod veing characterized by compensating for deviations from thepredetermined frequency of the acoustic wave packet as detected by thetransducer.

BRIEF DESCRIPTION OF THE DRAWINGS

A number of preferred embodiments of the present invention will now bedescribed with reference to the drawings in which:

FIG. 1 depicts the arrangement of two ultrasonic transducers disposed inthe field of flow of a fluid, the ultrasonic transmissions of which areused to measure the flow velocity of the fluid according to thedescribed embodiment;

FIG. 2 is a schematic block diagram representation of the functionalunits of the preferred embodiment;

FIG. 3 depicts a typical ultrasonic waveform emitted by the ultrasonictransducers in FIG. 1;

FIG. 4 is an information flow diagram for the preferred detectionmethod;

FIG. 5 illustrates the signal amplification and digitization processused in the described embodiments;

FIG. 6 illustrates the effect of increased gain on the digitizedwaveform;

FIG. 7 is a schematic block diagram of the electronics for a firstembodiment;

FIG. 8 is a schematic representation of the multiplexer unit of FIG. 7;

FIG. 9 is a schematic block diagram of a second embodiment whichutilizes the so-called “ring-around” method;

FIGS. 10A and 10B illustrate the firing sequence for the transducers inthe embodiment of FIG. 9;

FIGS. 11A and 11B illustrate the timing of that firing sequence of FIGS.10A and 10B for the two transducer drivers in the embodiment of FIG. 9;

FIG. 12 is a schematic block diagram representation of a thirdembodiment in which the two ultrasonic transducers transmitsimultaneously; and

FIG. 13 is a schematic representation of part of the microprocessor usedin the described embodiment.

BEST AND OTHER MODES FOR PERFORMING THE INVENTION

FIG. 1 shows two ultrasonic transducers, T1 and T2, each of which canact as either a transmitter or a receiver, disposed facing each otheralong the axis of a cylindrical measurement chamber C and separate by alength L through which a fluid F, whose flow velocity ν is to bemeasured, is flowing. The measurement chamber C is part of an overallmeasurement circuit 30 represented schematically in FIG. 2.

The measurement system 30 includes a controlling microprocessor 33linked via a main bus 37 to a microelectronics unit 31 which containsspecialist electronics that interconnect to the transducers T1 and T2,and to a temperature probe 32, positionable within the measurementchamber C to determine the temperature of the fluid F whose flow isbeing measured. A battery unit 36 supplies electrical energy to themicroprocessor 33 and microelectronics unit 31, the latter of the twogenerating signals for and receiving signals from the transducers T1 andT2, and determining individual times of flight (propagation) ofultrasonic wave packets. The microprocessor 33 provides for averagingmultiple times of flight and calculation of flow rate for display on aliquid crystal display (LCD) 34 via a display bus 38. A communicationsinterface 35 is provided to transfer the flow rate and other data to asuitable data acquisition system (not illustrated) but known in the art,for example from the aforementioned International Publication No. WO93/00569.

The value for the fluid flow velocity from the measured time of flightof an ultrasonic signal with, and against, the fluid flow, can bederived using the expression:

ν_(f)=0.5L(1/T _(d)−1/T _(u))

where:

ν_(f)=Velocity of fluid in the measurement tube,

L=Length of measurement tube,

T_(d)=Time-of-flight of acoustic pulse downstream, and

T_(u)=Time-of-flight of acoustic pulse upstream.

Accurate measurement of the time-of-flight (or propagation) is thereforethe central task in determining fluid velocity by the preferredembodiment. In the preferred embodiment, a short acoustic pulse train istransmitted from an ultrasonic transducer at one end of the measurementtube, which is detected (received) by a similar transducer at the otherend. After passing through a variable-gain amplification chain, thereceived signal is digitized at a rate of 10 MHz by an A/D converter togive receive data. The receive data is then input into 4 Kbyte of fastrandom-access-memory (RAM). To achieve the required accuracy, the timeof arrival of the acoustic signal must be determined to within about 1ns, ie. 1% of the time between digitization samples. It is thereforedesirable to interpolate between points on the digitized signal. This isdone by performing linear regressions on the receive data in a bandaround the quiescent signal level, and using the intercepts obtainedthereby, together with knowledge of the received signal frequency, tomake a number of separate calculations of the time of arrival. Aweighted average of these results forms the final estimate of acoustictransit time. To reduce the uncertainty of the measurement, in thepreferred embodiments a number of specific features are included.

Firstly, the A/D converter used is an 8-bit device which only operatesover a window covering approximately the middle one-third of thereceived signal, so that the effective precision of the conversion isincreased from 8 bits to (8+log₂(3)) bits, ie. about 9.6 bits. Such anarrangement is preferred because data points outside this middle rangeof a sinusoid carry more amplitude information than timing information,and are thus of little use to the timing measurement.

Secondly, the pulse generator for the transmitting transducer is linkeddirectly to the 10 MHz clock. All crystal clocks suffer jitter to someextent, and if a separate pulse oscillator were to be triggered from asingle clock transition, the full uncertainty of the jitter would beintroduced into the measurement. By tying each transition of theacoustic pulse generator to an edge of the 10 MHz clock signal, theeffect of clock jitter is substantially averaged out.

Thirdly, because the transducers are resonant devices, albeit weaklyresonant, the frequency of the received signal may not be the same asthat of the drive signal. Under the conditions of the presentlydescribed application, if the received frequency differs from thetransmitted frequency by say 10%, and no correction is made, an over-orunder-estimate of 0.35% will occur over the entire flow range. Theresonant frequency of many ultrasonic transducers changes noticeablywith temperature, so in calculating the arrival time of the beginning ofthe received signal, the period of oscillation is not assumed to beequal to the transmitted frequency, but rather is derived from thereceived waveform data.

One specific embodiment which realizes the advantages of this method inmeasuring the flow velocity of a gas, integrating this to measure thevolumetric flow and displaying that result, is depicted in FIG. 7.

In FIG. 7, a measurement system 60 is shown which includes a pipesection 61 adapted for the measurement of fluid flow, two transducers 62and 63 positioned within the section 61 and separated by a predetermineddistance for transmitting and receiving ultrasonic signals, a batteryunit (not illustrated for the purposes of clarity, but whose connectionwould be well understood in the art), a microprocessor 65, a liquidcrystal display (LCD) 66, a serial communications interface 67,measurement electronics 68 for driving and receiving from thetransducers and timing the ultrasonic flight time including a variablegain amplifier means 83 for altering the amplitude of the receivedsignal, and a probe 101 for measuring the temperature within the pipe61.

The microprocessor 65 is preferably a 16-bit device constructed using a“von-Neumann” architecture and which includes 4 Kbytes of read-onlymemory (ROM) and 256 bytes internal RAM. Also contained in themicroprocessor 65 is a universal asynchronous receiver-transmitter(UART), an analogue-to-digital converter (hereinafter μADC) with acurrent source, a timer with interrupt useable as an event counter and awatchdog timer crystal oscillator which is a time-of-day deviceproviding a 32.768 kHz signal. The latter is used as a real time clockand, when multiplied up by frequency-locked-loop techniques, is used asa clock for the microprocessor 65.

The LCD 66 incorporates a driver which interconnects to themicroprocessor 65 in a known manner.

An electronically-erasable programmable read-only memory (EEPROM) 72connects to a system bus 79, which is controlled by the microprocessor65, and provides calibration information for the measurement system 60.

The serial interface 67 enables the system 60 to be coupled to externaldevices through either an optical link, or some proprietarycommunications bus such as M-bus.

The battery unit preferably comprises a single 3.5 Volt D-size lithiumcell.

A controllable crystal oscillator 70 and crystal 71 provide, via a clockbus 99, a high-frequency clock, at a preferred frequency of 10 MHz, to ahigh-speed (flash-type) analogue-to-digital converter 85 (hereinafterflash ADC) and memory control logic 74 comprising an address counter 76and read/write control logic 75. The oscillator 70 is started prior to aflow measurement and allowed time to settle. When not required it isshut down to conserve power.

A transmit clock generator (transmit counter) 80 connects to the buses79 and 99 and divides the high-frequency clock to provide a clock signal100 for a transmit pulse sequence generator 81. The transmit frequencycan be varied under control of the microprocessor 65 by changing thenumber of high-frequency clock cycles comprising each transmit clockpulse.

The transmit pulse sequence generator 81 is formed by a shift registerthat holds a bit pattern which, when clocked out, forms the transmitpulse sequence. The bit pattern is initialized by the microprocessor 65via the bus 79 to which the sequence generator 81 also connects. Morecomplex waveforms can be generated by having more bits in the shiftregister and clocking at a higher rate. The edges of the outgoing signalare synchronized by the high-frequency clock. A quantization error isavoided at the start of the transmit by having the transmit sequenceclocked out by the same clock that controls the flash ADC 85.

The transmit pulse sequence is supplied to four tri-state drivers 94-97,arranged in two pairs 94 and 95, and, 96 and 97, each pair beingconnected to a different one of the transducers 62 and 63. The driverpair (eg. 94,95) connected to the transducer (62) which is going totransmit the ultrasonic signal, is enabled while the other pair (96,97)is placed in a high impedance state, allowing the transducer (63)connected to it to act as a receiver. The two outputs of a driver pair(94,95) are driven in anti-phase such that when one goes high the othergoes low. This effectively applies twice the drive signal to thetransducer (62).

Each of the ultrasonic transducers 62, 63 when receiving an acousticsignal appear to the remainder of the circuit as a differential currentsource.

To enable reception of the acoustic signal, each of the transducers 62,63 is connected to two analog multiplexers 92 and 93, which in turnconnect to corresponding current integrating preamplifiers 90 and 91respectively. A schematic representation of the analogue multiplexers 92and 93 is given in FIG. 8. The multiplexers 92,93 switch to select oneof two different ultrasonic input sources and connect it to the input ofthe preamplifier 90 or 91. The switches in the “off” state receive thetransducer drive signal.

Each preamplifier 90 and 91 amplifies the difference between the twocurrent signals coming from the corresponding transducers 62 and 63.This minimizes the effect of any interference which occurs on bothinputs, by cancel out common mode signals. The preamplifiers 90,91 alsosupply a DC bias for the analogue multiplexers 91,93, and in turn, thecorresponding transducer 62,63.

The gain of the preamplifiers 90,91 is high enough to ensure that theonly significant noise source is in the front end amplifier thereof. Thesignal is low-pass filtered while in the preamplifier stage to reducethe amplitude of the noise. It is advantageous to maintain one pole atabout 65 kHz.

A differential amplifier 89 sums the outputs of preamplifiers 90 and 91,and provides an input to a variable gain amplifier 83. The variable gainamplifier 83 is controlled by a gain control signal 82 output from themicroprocessor 65 so as to give a signal amplification range of 0 dB to60 dB. Such a range is required because the amplitude of the receivedsignal varies with the direction of the ultrasonic signal, with respectto the flow velocity, the amount of flow, and the temperature.

The received signal output from the amplifier 83 is then filtered by aband pass filter 84 operating between 80 kHz and 170 kHz. The output ofthe filter 84 has a DC level centered about a reference voltage, whichis generally about half the supply voltage provided by the battery unit64.

The bandpass filter 84 outputs to the flash ADC 85 which preferably hasan 8-bit resolution. The flash ADC 85 converts the received signal to adigital signal at a sampling rate equal to the high-frequency clockgenerated by the oscillator 70 (ie. 10 MHz). Operation of the flash ADC85 is depicted with respect to the waveform in FIG. 5. If the receivedsignal lies between signal levels designated as Top Ref (ie. a TopReference) and Bottom Ref (ie. a Bottom Reference), then the digitalvalue is a measure of this position. If the signal exceeds Top Ref thenthe output is FF (Hex) and if it is less than Bottom Ref its output is00 (Hex).

The Top Reference is a DC level generated by a circuit 87 which providesthe upper reference voltage for the flash ADC 85. The Bottom Referenceis a DC level generated by a circuit 88 which provides the lowerreference voltage for the flash ADC 85. The distance between TopReference and Bottom Reference is preferably set to 0.375 of the maximumheight that the amplified received signal can attain without significantdistortion. The position of these voltages must be such that when thesignal is at the maximum height it is centered, so that the amplifiers83, 87, 90 and 91 do not clip or distort the peaks of the waveform. Itis important to avoid any clipping of the waveform by the amplifiers 83,87, 90 and 91 because it will introduce a DC offset into the processedreceived signal.

A signal reference 86 is a DC level generated from Top Ref and BottomRef signal levels and lies midway between those two voltage levels. Thesignal reference 86 is used as the DC bias for the output of thebandpass filter 84 as discussed above.

The data samples taken by the flash ADC 85 are output on a signal databus 78 to which a high speed static memory (SRAM 77), which preferablyhas a capacity of 32 kbits, and a buffer latch 73 connect, the formerproviding for waveform storage of part of the received signal.

A Memory Read/Write Control unit 75 produces read and write pulsesrequired by the high-speed memory 77. An Address counter 76 within thecontrol unit 75 connects to the high-speed memory 77 and includes a12-bit counter with associated logic.

The waveform data from the flash ADC 85 is stored in the high-speedmemory 77 under control of the address counter 76 and memory read/writecontrol logic 75. The memory 77 has two modes of operation.

In a “Measurement mode”, data is transferred from the flash ADC 85 tothe static memory 77 in real-time. One byte is transferred for everycycle of the high-frequency clock, corresponding to a data transfer rateof 10 Mbytes per second. The address counter 76 provides the address tothe memory 77. In this mode, the address counter 76 is automaticallyincremented for each transaction. This means that the address has aone-to-one correspondence to the time the waveform is sampled after thetransmission of the ultrasonic signal.

In a “Processing mode”, retrieval and processing of data by themicroprocessor 65 is performed. Data can be transferred from or to themicroprocessor 65 from a selected address simply by loading the addresscounter 76 with the required address. The address counter 76 isincremented on each read or write of the high-speed memory 77 by themicroprocessor 65. Data from a series of addresses can, therefore, beread or written to another address by loading the address counters 76with the first address, then reading out or writing the bytes insequence. Data transfer between the memory 77 and the microprocessor 65is via the buffer latch 73. The microprocessor 65 reads from or writesto the latch 73 rather than directly to from or to the memory 77. Thisallows the memory 77 to remain in a low-power mode most of the timewhile the slower microprocessor 65 is reading or writing data.

With reference to FIG. 13, which illustrates only part of thearchitecture of the microprocessor 65, fluid temperature is measured bymeans of a microprocessor current source 69 driving a resistivetemperature sensor 101. The magnitude of the current source 69 isprogrammed by an external resistor 102. The input from the resistivetemperature sensor 101 can then be referenced back to the supplyvoltage, provided by the battery unit, in the same manner as the currentsource 69, thereby allowing a ratiometric measurement to take place.

As mentioned above, the microprocessor 65 includes a μADC 103 which isformed from a comparator 104, which receives the analog input, asuccessive approximation register 105, and a digital-to-analog converter(DAC) 106, a configuration well known in the art. A bidirectional buffer107 permits coupling of converted data onto internal buses 108 of themicroprocessor 65.

For the temperature measurement, the voltage is taken directly from thesensor 101 and applied to an analogue input of the μADC 103. The sensor101 is a resistive temperature sensor supplied by the current source 69.The magnitude of the current source 69 is a function of the supplyvoltage and is programmed by the external resistor 102, such that:

I _(source)=(0.25.V _(dd))/R _(ext).

The input from the resistive temperature sensor 101 is, thus, referencedback to the supply voltage in the same manner as the current source 69:

V _(in)=(0.25.V _(dd)).(R _(sens) /R _(ext)),  (1)

where R_(sens) is the sensor 101, a temperature varying resistiveelement.

The μADC 103 output is a linear function of the supply voltage:

V _(DAC)=(a+K.N).V _(dd)  (2)

where a and K are known constants and N is the multiplier of the DAC106.

The comparator 104 compares the output of the DAC 106 with the voltagefrom the sensor 101. This determines the N value for whichV_(dac)=V_(in).

The measured value N can then be output via the buffer 107 fortemperature compensation calculations. The measurement of R_(sens) isratiometric. Combining equations (1) and (2) above removes the supplyvoltage from the calculation, to give:

(0.25.V _(dd)).(R_(sens) /R _(ext))=(a+K.N).V _(dd)

R _(sens)=(a+K.N).4.R _(ext)

Also, the buffer 107 can be used for automatic gain control whereby themicroprocessor 65 determines the appropriate value, which is then inputto the DAC 106 via the buffer 107. The DAC 106 then performs a directconversion-to provide the gain control voltage 82. A switch 109 isprovided to isolate gain control functions from temperature functions.In view of temperature being relatively stable over more than onesample, which requires gain control determination, temperature functionscan be performed when flow measurements are idle.

In an alternative configuration, a parallel or serial (eg. I²C) outputof the microprocessor 65 can drive an external DAC (not illustrated)which can directly supply the gain control voltage 82.

Conservation of power is important for long battery life. Currentconsumption is reduced by maintaining the electronics in a low powermode whenever possible. The address counter 76 can be used to helpachieve such conservation if it doubles as a wake-up delay counter.

If the address counter 76 is initialized to a value other than zero,then the carry from the counter 76 can be used as a wake-up interrupt tothe microprocessor 65. The microprocessor 65 wakes up and turns on thesignal path electronics consisting of preamplifiers 90,91, differentialamplifier 89, variable gain amplifier 83, bandpass filter 84, enablesthe memory 77 and the flash ADC 85. The microprocessor 65 then returnsto a low power mode while the data is being collected.

Having described the structure of the measurement system 60, themeasurement of the time of flight will now be described in detail withreference to FIG. 4, which depicts schematically the flow of informationand a number of method steps resulting from the embodiment of FIG. 7.

At Point (1), the 10 MHz clock signal, generated by the oscillator 70,provides (timing reference information. At Point (2), to cause the startof a measurement, the 10 MHz clock is used, by the counter 80 andgenerator 81 to generate a train of three square-wave pulses ofnominally equal mark/space duration, which are fed to the transmittingtransducer in the measurement tube 61 for generation of the ultrasonicsignal. In the present example, the ultrasonic signal preferably has afrequency of approximately 125 kHz, so each cycle of the ultrasonicsignal has a duration of 80 cycles of the 10 MHz clock. Use of the 10MHz clock to generate the transmitted signal ensures that the timing ofthe transmitted waveform is accurately known. At Point (3), starting onthe same clock transition as the transmitted signal, the address counter76 is enabled. Thus, a synchronous counter is used to generatesequential addresses for the memory 77 at the rate of one address per100 ns.

As indicated at Point (7) in FIG. 4 and as discussed above, the outputof the receive transducer, which includes the desired analogue waveform,is passed to the flash ADC 85 in which the conversions to digital formare triggered by transitions of the 10 MHz clock. The memory 77 thusreceives its address control information from the address counter 76 andits data from the flash ADC 85, at the rate of one byte every 100 ns.The static memory 77 can therefore store 409.6 μs of digitized waveform.Some time after the transmit is initiated, and while the acoustic wavepacket is still propagating along the measuring tube 61, the flash ADC85 and the static memory 77 are enabled and the incoming data, initiallya DC level, begins to be written into the static memory 77.

To conserve power the microprocessor 65 does not activate the staticmemory 77 until shortly before the expected arrival time of the acousticsignal. If conditions have changed and the signal is missed, themeasurement is repeated with more conservative settings. Because therequired part of the received waveform is much shorter than 409.6 μs,the turnover of the address counter 76 and the subsequent overwriting ofthe static memory 77 do not constitute a disadvantage.

The acoustic wave packet generated by the transmitting transducertravels along the measurement tube 61 and, after about 500 μs (in ameasuring tube of length 175 mm and a speed of sound in natural gasreticulation systems of about 350 ms⁻¹), it is received by the receivingtransducer, resulting in an analogue electrical signal, such as thatshown in FIG. 3, being output from the receiving transducer. This signalis amplified in a number of stages, including one variable-gain stage,and the result is a signal, indicated at Point (5), of a known,standardized maximum amplitude. The gain-variation derivation isdescribed below. The received acoustic wave packet is thus converted bythe flash ADC 85 and stored in the static memory 77.

The microprocessor 65 stops the collection of data after the anticipatedarrival time of the acoustic wave packet. The address counter 10 MHzclock is stopped and the 10 MHz clock to the flash ADC 85, which alsofunctions as a write strobe to the static memory 77, is stopped. If thewave packet is missed then the measurement is repeated using a largerdelay. The largest possible delay will correspond to the greatestpossible retardation of the acoustic wave packet due to maximum fluidflow in a fluid of the highest density at the lowest temperature. Theaddress counter 76 must be left running during the entire period fromthe initiation of the acoustic signal, to the time at which themicroprocessor 65 disables the static memory 77, otherwise the positionof a data byte in static memory 77, will not correspond to its time ofarrival.

With a digitized representation of the received signal in the staticmemory 77, the microprocessor 65 and its associated software can thenextract an estimate of the time of arrival of the acoustic signal. Thisis done by resetting the address counter 76, and switching its inputfrom the 10 MHz clock to an output line of the microprocessor 65. Astarting address is loaded into the address counter 76 and, by togglingthe aforementioned microprocessor output line, the software can accesssubsequent bytes of the static memory 77 in sequence. The startingaddress is also loaded into a memory location in the microprocessor 65,and this “shadow” address value is incremented every time a data valueis fetched from the static memory 77. To establish a quiescent signallevel 45 (see FIG. 3), which precedes the arrival of the acoustic wavepacket and which acts as a reference against which all othermeasurements are compared, a number of bytes, typically a power of 2such as 128 or 256, are read from the static memory 77, summed and thenaveraged. The starting point for the address counter 76 must be lowenough to allow for this determination of the quiescent signal level 45from data received prior to the earliest anticipated arrival of theacoustic signal. The quiescent signal level 45 is thus representative ofa no-received-signal (NRS) state of the measurement system 60. Also, theearliest anticipated arrival of the acoustic signal represents thecommencement of a measurement portion of the stored digital signal datawhich is representative of an analogue signal output from the transducerindicating a response of the transducer to the acoustic wave packet. Themeasurement portion can extend for about 10 to 20 cycles of the receivedsignal 40.

Once the quiescent signal level 45 has been determined, at Point (8) asoftware circular buffer is established by the microprocessor 65, havinga length preferably corresponding to about 10 to 15% of one cycle of theacoustic signal. In the present example, where approximately 80 signallevel samples are taken per cycle, a circular buffer size of 9 orpreferably 10 bytes is suitable. The circular buffer technique permitsdata to be updated without a need to physically shift each entry alongone place every time a new data item is entered. A buffer pointer,initially zero, points to the position in the circular buffer where thenext entry is to be made. The pointer is incremented after each newentry is made, and when the value of the pointer exceeds the length ofthe circular buffer, the pointer is reset to zero. Thus, the pointertherefore “circulates” around the circular buffer, and once the circularbuffer is filled, the pointer position at any time denotes the earliestentry in the circular buffer.

As each byte is read from static memory 77, and prior to being placed inthe circular buffer, it is compared with the quiescent signal level 45previously obtained, and the sign of the difference is compared with thevalue obtained from the previous byte. If the sign is the same as thatcalculated from the previous byte, the received signal has not crossedthe quiescent signal level 45 and the current sign is stored for afuture comparison. If the current sign differs from the previous sign,the received signal has crossed the quiescent signal level 45 and alimit is set that is equivalent to the current value of theaforementioned “shadow” address value, plus half the circular buffersize. Bytes are then read from the static memory 77 and put into thecircular buffer until the shadow address value reaches theabovementioned limit, at which time the circular buffer contains a setof data points approximately equally disposed about the quiescent signallevel 45. This represents a measurement segment individually manipulablefor timing calculations.

At this stage, the contents of the circular buffer are used to perform alinear regression, indicated at Point (9) in FIG. 4, using the shadowaddress values corresponding to the time axis as the independentvariable, and the data items in the circular buffer as the dependentvariable. The linear regression comprises fitting the data pairs ofvoltage and time to a straight line using a least-squares technique. Theregression line technique allows an estimate of the slope of the signalas it passes through the quiescent signal level 45, and also a timeintercept value at that point time, which are determined for eachmeasurement segment.

It is also possible to determine the half period of the waveform by thetime interval between successive time intercept values and a waveformperiod by the time interval between alternate time intercept values. Thevalue of the waveform period can thus be determined independentlyseveral times in the same waveform by taking a plurality of slopes. Anaverage waveform period can be obtained by averaging these severalvalues.

At Point (10) both the slope and intercept estimates are placed in asoftware First-In-First-Out (FIFO) buffer in the internal memory of themicroprocessor 65, for later use. The computationally less-efficientFIFO buffer is used for this application because it is short, access toit is relatively simple, and it is updated at only one-fortieth the rateof the circular buffer.

Because, as seen in FIG. 3, the received waveform begins imperceptiblyand builds up in amplitude over several cycles, it is not possible todirectly determine its starting point. The start point must be inferredby locating a later position on the waveform (this position being usedas a timing marker) and subtracting a time period corresponding to aknown number of waveform cycles (which period in turn corresponds to thetime elapsed from the start point of the wave packet) from that time.Typically, the position in the received signal 40 used as a timingmarker in the timing of the transit of the wave packet along the tube 61is a particular position on the waveform when the waveform passesthrough the quiescent signal level 45.

The intercepts determined from the linear regression at Point (9) thusserve as the timing markers if their absolute position can be determinedwithin the waveform as a whole. To do this, the successive slope valueswithin the FIFO buffer are compared with a stored set of slopes,referred to herein as a “template” and indicated at Point (13). Thisstored template is representative of the early part of the waveform, theshape of which may vary depending on the fluid flow rate, the propertiesof the fluid, and the temperature. A convenient size for this templateis two to four elements, either of successive slope magnitudes ofalternating sign, or alternate slope magnitudes of the same sign. Oncethe FIFO buffer of slopes has been filled, as each new slope value(including magnitude and sign) is inserted, selected elements arecompared at Point (14) with the template to obtain a sum-of-squares ofdifferences. This measure passes through a minimum when the templatebest matches the selected elements of the FIFO slopes buffer, and theprocess stops the matching process when the newly calculatedsum-of-squares exceeds the previous value. At this stage, the interceptshave been correctly located within the waveform as a whole, based on theknown template, with each intercept being nominally an integral numberof half-periods from the start of the received signal. Thus, thematching of the slopes identifies a specific location or determines ameasurement position for each slope within the received analog signalwaveform, which is related to the commencement of the acoustic wavepacket.

As indicated previously, the frequency of the received waveform may notmatch that of the drive signal, meaning that the drive waveformhalf-period may not be a good estimator for the half-period of thereceived waveform. This is particularly so where the signal is in theform of a short burst rather than a long wavetrain. Where thetransducers 62 and 63 are made of a material such as PVDF, the resonantfrequency of the coupled transducer/chamber/fluid combination, dominatesthe form of the received signal, and this resonant frequency can varymarkedly (10 to 15%) with temperature and fluid properties. In addition,ageing effects can alter the piezo and elastic properties of thetransducer, producing changes in the sensitivity and resonant frequencyof the system. To cater for these changes, at Point (15) the receivedwaveform period is modified over time to track changes by using a slowmoving average of the received waveform period to compensate fordeviations in the received signal due to changes in resonant frequencyof the transducer over time kept for calculating the start point of thereceived signal. This average can be conveniently updated fromdifferences in the intercept values of the FIFO buffer. A fraction ofthe difference between the freshly-calculated half-period and the oldhalf-period value is added to the old value. If the fraction is, forexample, 0.1, then after 20 repetitions the moving average will cover88% of a step change in the half-period. Using smaller fractions of thedifference will result in correspondingly slower responses in the movingaverage. This moving average is then used, at Point (16), as thereceived signal half-period.

Any intercept value in the FIFO buffer can be used to estimate thearrival time of the start of the waveform, by subtracting theappropriate number of waveform half-periods. To improve accuracy, morethan one intercept can be used and the results can then be averaged. Itis preferable to use a weighted average, where the weighting factors,indicated at Point (17), are derived from the slope corresponding toeach intercept. The earlier intercepts are from a low-amplitude part ofthe received signal and are therefore relatively more affected by noise.Since the maximum slope of a sinusoid is proportional to its amplitude,the weighting factors are made proportional to the absolute slope ateach intercept, averaged over temperature and fluid type. Theweighted-average estimate of the waveform start, indicated at Point(18), is calculated by the microprocessor 65 in terms of sample numberand fractions thereof since the last turnover of the address counter 76.In the present instance, the address counter 76 would have “turned over”at 409.6 μs, so that the total time-of-flight of the acoustic signal,indicated at Point (19) is:

T _(d,u)=(409.6+(weighted-average estimate of waveform start)/10)μs.

At Point (6), a new gain estimate referred to above, is calculated fromthe maximum slope, derived at Point (11), encountered in the FIFO bufferof slopes. The magnitude of the maximum one of said slopes allows theamplitude of the peak 41 which is the maximum amplitude of the analoguesignal to be estimated and hence, by adjustment of the gain of theamplifier 83, for the amplitude of the peak 41 to be held constant, orat least substantially constant within a predetermined range ofmagnitudes. Those limits are generally within ±5%, and preferably about±2.5%. To allow the gain to stray beyond those limits can result in amis-matching of the template to the measured slopes, and therefore aninaccurate locating of those intercepts. If the gain of thevariable-gain amplification stage produces a signal output directlyproportional to its input control voltage, the gain re-estimate can beobtained from the equation:

G _(n)=(G ₀)(Target Max. Slope)/(S _(n))

where:

G_(n)=Re-estimate of required gain,

G₀=Previous gain value, and

S_(n)=Most recent maximum slope.

However, depending on its design, the response of the gain control stagecan better be approximated by an exponential or polynomial curve. In thepresent case, a cubic gives a satisfactory fit and, after linearization,the gain prediction equation can be expressed as:

G _(n) =G ₀ +C ₁ −C ₂.(³{square root over (S _(n) −C ₃+L )))}

where C₁, C₂ and C₃ are constants to fit the particular DAC 106 andamplifier combination, which in the present case are 59, 10.24 and 10respectively. The result of such gain control is that the maximum slope,encountered in any one received wave packet, is maintained substantiallyconstant for consecutively transmitted wave packets.

The re-estimated gain value G_(n), indicated in Point (12) in FIG. 4, isa number between 0 and 255, which is fed to a DAC 106 indicated at Point(20), to produce the gain control voltage 82, indicated at Point (6) forthe gain-control amplifier stage.

At start-up, there is no previous value of maximum slope from which toderive the new gain. Therefore, a typical value is stored in memory asthe initial estimate from which to work.

There can be occasions when the required gain must change abruptly, forexample when the temperature of the fluid changes rapidly. Aparticularly difficult condition occurs when the required gain fallsvery suddenly and the estimate derived from the previous measurement ismuch too large. FIG. 6 shows seven examples of the effect of increasinggain on the digitized waveform, where the gain increases by a factor of1.5 from one plot to the next. In Plot 1 the gain is too low, whereas inPlot 7 the gain is too high. The target condition is similar to thatshown in Plot 3 or Plot 4 with 9 or preferably 10 data points fallingbetween the upper and lower saturation values. Such a conditionmaximizes the sensitivity of fit for the linear regression exercisewhich follows the gain-setting process.

A consequence of this, and an advantageous feature of the preferredembodiment, is that the procedure for gain-setting is extremely robust,being able to respond well to all of the conditions likely to be metunder real conditions. The measured slope is a monotonically increasingfunction of the gain, so the gain-setting process is able to adjust thegain in either direction. In particular it is able to correct rapidlyfor a situation with excessively high gain.

One additional situation which must be avoided is that of zero gain.Because the arithmetic of the microprocessor 65 is fixed-point, a verysmall gain value can be truncated to zero. Because the new gain estimateis derived from the previous value by multiplication, the gain-settingprocess cannot recover from a zero gain situation. Therefore the processincludes a zero check, wherein a non-zero value is substituted for thenext gain if the calculated gain value is zero.

It will be apparent from the above described method that it is notnecessary to measure the maximum or minimum values of the receivedsignal and hence it is not necessary to have access to that part of thewaveform. This allows the electronic gain to be set so that the peaks ofthe waveform lie above and below the voltage range of the flash ADC 85.By operating in such a state the middle part of the waveform can bedigitised with an enhanced amplitude resolution. This enhances theaccuracy of the entire process of determining when the signal has passedthrough the NRS state.

Also, as long as the absolute position of the timing markers in thewaveform has been determined, it is possible to use any of the occasionswhen the signal passes through the NRS state as timing markers. Anaverage can be then taken of the estimated time of arrival of the signalbased on a number of those markers. The average is advantageouslyweighted according to the slope of the waveform at that time, since theaccuracy of the estimation of the time when the signal passes throughthe NRS state is better when the slope of the signal is highest.

Using the method developed, it is possible to perform all the neededprocessing of the data in a single scan of the data. This has theadvantage of requiring less time and less energy for its execution thanfor methods that need multiple passes of the data through the processor.

The method also makes it possible to take account of the ageing of thetransducers, or other processes that may change the shape of thewaveform, by slowly updating the template against which the waveform iscompared. This is possible because there is a large degree of differencepermitted while still obtaining a correct determination of the absoluteposition in the waveform.

Further, by using a clocked shift register to provide the transmitpulses, the edge jitter on the quartz clock pulses can be reduced andhence an increase in the accuracy of timing can be obtained.

In a second embodiment of the invention, the method and arrangementdescribed above is combined with the so-called “ring-around” methoddescribed in the above mentioned International Patent Publication No. WO93/00569. In the configuration of measuring tube and transducersdescribed in WO 93/00569, an ultrasonic pulse is required to be timed toan accuracy of 1.56 ns to attain the required flow accuracy. If a singlezero crossing were used for this timing, a clock running at 640 MHzwould be required. The same accuracy can be achieved at a much lowerpower consumption by timing at 10 MHz and sending the signal down thetube 64 times.

In such a scheme implemented using the teachings of the presentinvention, the received pulse can be examined each time to identify thecrossing of the quiescent signal level 45 on which to retransmit thenext pulse. An ultrasonic burst is sampled digitally and a delaydetermined which acts to inhibit retransmission until the arrival of anominated crossing of the ultrasonic pulse. The transit time of theultrasonic bursts is then determined more accurately by transmitting asequence of ultrasonic bursts, each burst after the first beingtransmitted upon reception of the immediately preceding burst. The delayis initialized at each transmit and retransmit which occurs on acrossing of the quiescent signal level 45 of the received ultrasonicpulse only after this delay has expired.

This method has the advantage that the delay to the crossing of thequiescent signal level 45 is determined with a single ultrasonic burstso that higher order acoustic modes from previous transmissions are notpresent. Further, the method requires less energy to run a slowercounter and transmit the ultrasonic signal several times. Theidentification of a specific crossing is better performed from a timeddelay. Acoustic modes remaining in the tube from previous transmissionswill modulate the received ultrasonic signal and cause its envelope tovary in shape. The retransmit crossing is little affected by residualmodes because the energy of the signal is relatively high at thisposition.

A crossing of quiescent signal level 45 by the received ultrasonic burstis selected as the “retransmit crossing”. This crossing should be onewhich arrives before any significant secondary modes, but also arrivefar enough into the waveform to be little affected by noise. A suitablecrossing for the measuring tube described here has been found to occurtwo and one half cycles into the waveform.

A measurement system 120 which realises the advantages of such ameasurement scheme is depicted in FIG. 9, where components having likestructure and function to those in FIG. 7 are provided withcorresponding reference numbers, some other common components beingomitted for the purpose of clarity, which will be understood by thoseskilled in the art.

During a scan, a transmit oscillator 127 is enabled on a crossing ofquiescent signal level 45 by the received signal 40. The oscillator 127replaces the pulse generator 81 of FIG. 7 and is asynchronous to a scantiming counter clock 125, and outputs to the tri-state drivers 94-97.

The scan timing counter clock 125 is provided in a transmit controller121, which replaces the transmit counter of FIG. 7, and comprises a24-bit resettable counter used for measuring the cumulative time that ittakes to send pulses from one transducer to the other. The counter 125is reset at the start of the first transmitted pulse in a scan andcounting is disabled after reception of the last received pulse in ascan.

Control logic 124 is provided in the controller 121 to integrate thefunctions of the transmit controller 121.

The controller 121 also includes a load register 122 which receives adelay value from the microprocessor 65 via the bus 79. That value isthen placed in a delay counter 123 which is used to time the delaybefore retransmission is enabled. This counter 123 is loaded each timethere is an ultrasonic transmission.

Flow measurements are specifically performed in the following stages:

1. The transmission direction is selected using direction lines 98 a and98 b.

2. The receiver gain is adjusted, under the control of themicroprocessor 65, until the slope of the received ultrasonic burststransitions are within an established specification.

3. The crossing detection delay is initialized. In this first stage, thewaveform is sampled digitally, and the time from the ultrasonic transmitto the arrival at the detector of the crossing that has been selected toinitiate a retransmit is determined. A delay value less than this byhalf a period of the ultrasonic burst, is loaded into the delay counter123 by the microprocessor 65.

4. In this stage of the measurement, the transit time of the ultrasonicpulses is determined more accurately by transmitting a sequence ofultrasonic bursts, each burst after the first being transmitted uponreception of the immediately preceding burst. The generation, emissionand detection of a single ultrasound burst will henceforth be referredto as a “ringaround”, also sometimes known as a “singaround”. A singlescan of the fluid flow consists of two sets of a predetermined number ofringarounds, first in one direction and then in the other. A sequencecan include any number of ringarounds, but advantageously will involve64.

The delay counter 123 and the timing counter 125 are started when thefirst ultrasonic burst is sent. The leading edge of this firstultrasonic burst is synchronized to the timing clock 70. The start ofthe second and subsequent ultrasonic bursts is asynchronously triggeredby the arrival at the detector end of the measuring tube 61 of aspecific crossing belonging to the preceding ultrasonic burst. Thespecific crossing which triggers the retransmit command is the firstcrossing of the quiescent signal level 45 of the required polarity(positive- or negative-going) to arrive after the delay counter 123 hastimed out. The polarity required for a crossing to generate a retransmitdepends on the polarity of the preceding transmit. A comparator 126 isprovided to detect these crossings and includes inputs connected to thesignal reference 86 and the bandpass filter 84. An output of thecomparator 126 connects to the transmit controller 121 to trigger are-transmit command.

The delay is re-loaded into the delay counter 123 at the start of thenext ultrasonic burst and immediately commences to count. The timingcounter 125 is stopped by the arrival at the detector of the specificcrossing belonging to the last ultrasonic burst. This specific crossingis also identified by the delay counter 123. At the end of a series ofringarounds, the value in the high speed timing counter 125 istransferred to the microprocessor 65. The second (opposite) transmissiondirection is selected and the above sequence is repeated. The storedhigh-speed counter 125 values for both directions are used by softwarein the microprocessor 65 to calculate the flow rate for the scan period.The time taken by the sequence as a whole can be divided by the numberof bursts transmitted to determine the average travel time.

A ringaround sequence is usually made up of groups of four firings. Thissequence of firings is depicted in FIGS. 10A and 10B. The sequence offour is made up of three pulses of one polarity while the third isinverted with respect to the first three pulses.

To keep the polarity reversal away from important events, the polaritychange is achieved by adding an extra edge on the end of the transmitpulse sequence prior to the transmit having a different polarity. In agroup of four firings, the signal inverts after the third and restoreson the fourth firing.

A ringaround sequence consists of, typically, 64 acoustic transmissionsin each direction, all but the first being triggered by reception of thepreceding transmission. To assist in cancel the buildup of coherentacoustic noise in the measurement tube as the ringaround sequenceproceeds, the polarity of the transmitted signal is reversed on aregular basis throughout the sequence. The sequence is notionally madeup of groups of four transmissions, with the polarity of every fourthtransmission reversed with respect to the other three. Thus, if the twopossible polarities are designated “A” and “B”, a sequence of 64transmissions could have a polarity pattern of “AAABAAABAAAB . . . ”,the “AAAB” pattern being repeated 16 times overall. The polarity of thecrossing comparator 126 on the received signal is reversed just after a“B” polarity transmission and changed back again just after the firstfollowing “A” polarity transmission to ensure that it matches thereceived signal polarity. Further, to cancel errors which might beintroduced due to offset on the comparator 126, the overall polarity ofthe ringaround sequence is reversed for each complete gas velocitymeasurement. Thus the polarity sequence above becomes “BBBABBBABBBA . .. ”, again with the appropriate reversals of the polarity of thecrossing comparator 126 on every fourth transmission.

A typical timing diagram for such a measurement sequence is depicted inFIGS. 11A and 11B.

A further embodiment of the invention comprises a measurement system 140schematically depicted in FIG. 12 and in which transmission of theultrasonic signal simultaneously occurs in both directions relative tothe direction of fluid flow. Again, like reference numerals are used forlike components having like functions, some components have again beenomitted for the sake of clarity.

This embodiment is suitable for rapidly changing flows such as occurs inpeak flow meters. Transmission occurs from both transducers 62 and 63 atthe same time, then at a suitable time later (advantageously about 500μs in natural gas) both transducers 62 and 63 are used as receivers forthe signal transmitted by the other transducer. Two separate sets ofreceive electronics are required, which correspond in function to thoseof FIGS. 7 and 9, but whose components are respectively identified usingthe suffixes A and B.

It is extremely difficult to make the two sets of receive electronicssufficiently identical in order to avoid introducing significantlydifferent phase delays. These phase delays vary with conditions such astemperature and gain.

To cancel out such an introduced phase difference, a filtered andattenuated version of the transmit signal is connected to bothreceivers. This is achieved by passing the outputs of the transmit pulsegenerator 81 firstly through a filter 141 and then to a variableattenuator 142 controlled by a control signal 143 output from themicroprocessor 65. The variable attenuator 142 outputs to a fixedattenuator 144 which supplies two analog multiplexers 92A and 93B, whichare of similar construction to the multiplexers 92 and 93 of theprevious embodiments, excepting they are each of adouble-pole-double-throw construction, rather than asingle-pole-double-throw construction as used previously. This signal isprocessed by both sets of receive electronics and stored in the memory77. Because of the need to store two sets of received data, the memory77 is modified to simultaneously store double bytes (16 bits) of dataand thus has a preferred total capacity of 64 Kbits. The signal isfiltered so that its transition time is greater than eight cycles of thehigh frequency clock. This allows each flash ADC 85A, 85B to obtainsufficient samples for an interpolation. The difference in phase delaycan be calculated from this stored signal and used to calculate thecorrect time difference for the upstream and downstream directions.

The actual measurement procedure for this embodiment can then follow thefollowing sequence:

1. The tri-state drivers 94-97 to the up and down transducers 62,63 areenabled. Both receivers A and B are connected to a transmit signal thathas been filtered, attenuated, and amplitude adjusted. Both sets ofreceive electronics are enabled and a first block of the memory 77 isselected.

2. The address counter 76 is enabled and the signal transmitted in bothdirections. Data, typically corresponding to only a few cycles, fromboth sets of receive electronics are stored in the first block of thememory 77. That data permits the phase delay calculation discussedabove.

3. The receive electronics are disabled and a second, generally muchlarger, block of the memory 77 is selected. The multiplexers 92A, 93Bare changed so that the transducers are connected to the receiveelectronics.

4. To conserve power, the receive electronics are disabled until justbefore the ultrasonic pulses are due to arrive.

5. Both sets of receive electronics are enabled and data from both setsof receive electronics are stored in the second block of the memory 77.

In such a scheme, during the transmit sequence a much reduced version ofthe signal is coupled into the two preamplifiers. The amplitude of thissignal is variable so as to accommodate different gains in the receivingamplifiers. This transmit signal passes through the amplifier chain andthe flash ADC's and is stored in the memory. The multiplexers are thenchanged so as to receive the signal from the transducers and a higherorder, non-counting, memory address line is changed. The lower bits ofthe address counter 76 continue to count. The receive electronics(preamplifier, variable gain amplifier, filter, flash ADC's and memory)are all disabled until it is time to receive the ultrasonic pulse.

The data in the first block of the memory 77 is used then to determinethe current phase delay in the manner described above. The same processis then applied to the data in the second block of the memory 77. Thephase difference for each direction is then determined. The actual timesof propagation are then determined using that data from the second blockof the memory 77, and are adjusted where appropriate by the calculatedphase difference and then retained for averaging.

In each of the embodiments, once the microprocessor 65 determines theaverage flow rate, that value can then be used to calculate the flowvolume which can be incrementally retained. The flow rate andincremental volume over a period of time can then be displayed by theLCD 66. Such information can also be communicated via the serialinterface 67 to a data acquisition system. Typically, flow ratecalculations can be enabled at periodic intervals, generally between 0.5seconds and 60 seconds. Preferably the interval is about 2 seconds.

It will thus be apparent from the foregoing embodiments that the generalmethod relies on the conversion of the analogue wave packet signal todigital information, and the subsequent use of this digital information,by comparison with a standard digital template of selected waveformfeatures, both to uniquely identify a number of particular cycles of thewaveform and to combine this information to give an elapsed timemeasurement of significantly reduced uncertainty for the arrival of thereceived wave packet.

Further, a preferred implementation allows the response of theelectronics of the system to the no-received signal (NRS) state to bemeasured. This is achieved by averaging the digitized data taken beforethe arrival of the signal.

The preferred implementation also allows the slope of the voltagewaveform as a function of time to be determined by a technique offitting the data pairs of voltage and time to a straight line using theleast-squares technique.

The value of the maximum slope allows the amplitude of the signal to beestimated and hence, by adjustment of the gain of the amplifiers, forthe amplitude of the received signal to be held constant or within apredetermined range of magnitudes. It then follows that the magnitude ofthe slopes of the signal lie within a predetermined range of magnitudes.

Using the slopes of this essentially constant amplitude signal, it ispossible to determine the absolute position in the waveform of anyfeature by reference to a stored template. The feature used as a timingmarker in the timing of the transit of the signal down the tube is aparticular one of the several occasions when the waveform passes throughthe NRS state.

The exact time that the waveform passes through the NRS state isdetermined from the function fitted to the data pairs mentioned above.This allows the timing accuracy to be enhanced by effectivelyinterpolating between clock pulses, thus overcoming the quantizationthat would otherwise be present.

The preferred implementation of the present invention confers certainadvantages in its use as an ultrasonic signal timing technique.

Firstly, the preferred method is less affected by temperature than othermethods because it uses the leading part of the wave packet. Thisleading part of the wave packet consists principally of the plane waveand this is much less affected by temperature than are the higher ordermodes forming the latter part of the wave packet.

The preferred method also makes major use of a quantification of theslope of the waveform as it makes a transition from a negative to apositive peak or vice versa. An array of slopes is used to describe thewaveform in a simple and concise way. This also gives the user theability to compare waveforms with a minimum of data. The transitionslope also confers the ability to identify the position of thetransition within the waveform and thus calculate the position of thebeginning of the waveform. Each transition slope can also be used toinfer the amplitude of the accompanying peak and can be used as analternative parameter to the peak height, and thus the transition slopeprovides a useful parameter for the adjustment of gain in the system.

Further, the selection of only a portion of the amplitude of thewaveform can be used judiciously to increase the accuracy obtainablefrom the method. In the preferred embodiment, an increase of accuracycorresponding to approximately 1.6 bits is obtained by operating theanalogue-to-digital converter over a window covering approximately themiddle one-third of the received signal. The data describing thetransitions are thus more accurately defined and it is thereforepossible to have more resolution in the timing. This is possible becausethe preferred method does not use the peaks of the envelope for anymeasurement purpose and it is therefore possible to ignore them and usethe transition slope only.

The preferred method also confers the ability to accommodate any changesin the ultrasonic signal which might accompany the ageing of, or anydamage to, a transducer assembly, by slowly updating the templateagainst which the waveform is compared. This is possible because themethod permits a large degree of difference in the size and shape of thewaveform while still obtaining a correct determination of the absoluteposition of the timing marker within it.

In addition, by using a number of the transition slopes, the preferredmethod makes more use of a greater percentage of the information in thewaveform, rendering it more versatile and increasing the precision withwhich the timing measurement is made.

Using a specific implementation, it is possible to process all of thedata in a single scan. This requires less time and energy, and thusresults in greater unattended battery life for any system using it, thanmethods which require the data to pass through the processor more thanonce.

The foregoing describes only a number of embodiments of the presentinvention and modifications, obvious to those skilled in the art, can bemade thereto without departing from the scope of the present invention.

What is claimed is:
 1. A method of detecting an arrival time at atransducer of an acoustic wave packet transmitted at a predeterminedfrequency, said method comprising the steps of: (a) transmitting anacoustic wave packet at a predetermined frequency; (b) detecting at atransducer the acoustic wave packet and producing an analogue signaloutput; (c) converting, at a sampling frequency, the analogue signaloutput from said transducer into digital signal data havingconsequential spacing; (d) determining a measurement portion of saiddigital signal data, said measurement portion corresponding to aresponse of said transducer to said acoustic wave packet; (e)determining from said measurement portion a plurality of slopes S_(i)for a corresponding plurality i, where i is an integer between zero and20, of measurement segments of said response, each of said segmentsbeing about a signal level value V; and (f) determining from at leastselected ones of said slopes S_(i), an arrival time t of said acousticwave packet.
 2. A method as claimed in claim 1, comprising the furtherstep, between steps (e) and (f) of: (ea) determining, for selected onesof said segments, a corresponding measurement time A_(i) indicative of atime at which said response intercepts said signal level value V;wherein step (f) comprises determining said arrival time t from saidcorresponding measurement times A_(i).
 3. A method as claimed in claim2, comprising the further step, between steps (e) and (ea) of: (eaa)matching said slopes S_(i) with a corresponding reference set of slopesP_(j) to determine a measurement position of each of said segments insaid measurement portion; wherein step (ea) comprises determining saidcorresponding measurement times A_(i) from the corresponding one of saidmeasurement positions.
 4. A method as claimed in claim 3, wherein step(eaa) includes associating each slope P_(j) of said reference set ofslopes with a specific position parameter n, where said specificposition parameter n marks a position corresponding to a signal polaritytransition within said wave packet, and where each specific positionparameter n, corresponds to an integral number of half-wave periods ofsaid wave packet between a beginning of said wave packet correspondingto the arrival time of the wave packet and the corresponding signalpolarity transition within said wave packet.
 5. A method as claimed inclaim 4, further comprising updating said reference set of slopes overtime to compensate for changes in a resonant frequency of said analoguesignal.
 6. A method as claimed in claim 5, wherein updating saidreference set of slopes includes following a slow-moving average of saidslopes S_(i).
 7. A method as claimed in claim 4, where step (f)comprises the sub-steps of: (fa) assigning a weighting factor W_(i) toeach of said measurement times A_(i) based upon the correspondingposition parameter n; (fb) selecting a number m of said measurementtimes A_(i) for use in the determination of the arrival time t; (fc)determining a mean half-wave period τ from time intervals betweenadjacent ones of said number m of selected measurement times A_(i); (fd)determining, for each of the number m of selected measurement timesA_(i), an estimated arrival time t_(i) of said wave packet at thetransducer; (fe) determining a sum, over the number m of measurementtimes A_(i), of a product of the weighting factor W_(i) assigned to eachof said measurement times and the corresponding estimated arrival timet_(i); and (ff) determining the arrival time t of said acoustic wavepacket by dividing the sum determined in step (fe) by a sum of eachweighting factor W_(i) assigned to each of the number m of measurementtimes m.
 8. A method as claimed in claim 7, wherein step (fd) comprisesdetermining the estimated arrival time t_(i) using the expressiont_(i)=A_(i)−n·τ, wherein A_(i) are the measurement times, n is thecorresponding position parameter, and τ is the mean half-wave period. 9.A method as claimed in claim 7, wherein step (fa) includes assigning aweighting factor W_(i), which is proportional to the slope S_(i), of thecorresponding one of said segments.
 10. A method as claimed in claim 7,wherein step (fb) includes selecting a number m having a value from 2 to20 of said measurement times A_(i) for use in the determination of thearrival time t.
 11. A method as claimed in claim 7, wherein step (fb)includes selecting 6 of said measurement times A_(i) for use in thedetermination of the arrival time t.
 12. A method as claimed in claim 7,wherein step (fb) comprises selecting said measurement times A_(i) so asto give a closest match to the reference set of slopes Pj.
 13. A methodas claimed in claim 2, wherein step (e) comprises allocating a set ofpoints including an integer k number of points of said digital signaldata to each said measurement segment i, each said measurement segment ibeing centered around two adjacent points, each of the two adjacentpoints having a value which lies on alternative sides of said signallevel value V, fitting a straight line to each set of points, and thendetermining the slope S_(i) of each said straight line.
 14. A method asclaimed in claim 13, wherein fitting a straight line to each set ofpoints includes fitting a straight line to each of said two adjacentpoints.
 15. A method as claimed in claim 13, wherein allocating a set ofpoints including an integer k number of points includes deriving a valuefor k from a ratio of the sampling frequency to said predeterminedfrequency at which said acoustic wave packet is transmitted, and to theconsequential spacing of said digital signal data in said measurementportion.
 16. A method as claimed in claim 15, wherein allocating a setof points including an integer k number of points includes determining avalue of k equal to one eighth of a number of cycles of the samplingfrequency per cycle of said predetermined frequency at which saidacoustic wave packet is transmitted.
 17. A method as claimed in claim16, where allocating a set of points including an integer k number ofpoints includes allocating a set of 10 points of said digital signaldata to each said measurement segment i.
 18. A method as claimed inclaim 1, wherein step (a) includes, prior to transmitting an acousticwave packet, generating said acoustic wave packet using said samplingfrequency and determining said predetermined frequency at which saidacoustic wave packet is transmitted as a sub-multiple of said samplingfrequency.
 19. A method as claimed in claim 1, wherein step (e) includesderiving said signal level value V by averaging said digital signal datareceived in advance of said measurement portion.
 20. A method as claimedin claim 1, wherein step (c) comprises converting continuously saidanalogue signal.
 21. A method as claimed in claim 1, further comprisingdetermining a maximum magnitude of one of said slopes S_(i), estimatinga maximum amplitude of said analogue signal from said maximum magnitudeof one of said slopes S_(i), and using said estimation to maintain saidmaximum amplitude at a substantially constant level.
 22. A method asclaimed in claim 1, wherein step (c) comprises, before said converting,the step of: (ca) adjusting a gain of one or more amplifiers therebyadjusting an amplitude of said analogue signal such that a maximumamplitude of said analogue signal is held substantially constant over anumber of received acoustic wave packets.
 23. A method as claimed inclaim 22, wherein step (ca) includes determining a magnitude of amaximum one of said slopes S_(i), using the magnitude of the maximum oneof said slopes S_(i) for adjusting the amplitude of said analoguesignal, maintaining said maximum amplitude at a substantially constantvalue, and maintaining said maximum slope within a predetermined rangeof magnitudes.
 24. A method of determining a propagation time of anacoustic wave packet transmitted between two ultrasonic transducers,said method comprising the steps of: (g) starting a clock operating at aclock operating frequency; (h) simultaneously with a transition of saidclock, the steps of: (ha) energizing a first one of two transducers tooutput an acoustic wave packet at an energizing frequency which is lowerthan said clock operating frequency, and (hb) maintaining said clock asa timing reference for subsequent detection of an arrival of said wavepacket at a second one of two transducers; (i) detecting an arrival timeof said wave packet using the method as claimed in claim 1, wherein saidsampling frequency is said clock operating frequency and is provided bysaid clock, and said digital signal data including said measurementportion is stored in a memory having an address determination forconsecutive samples of said digital signal data being altered by saidclock such that each address in said memory corresponds to anidentifiable time which is identifiable after generation of saidacoustic wave packet.
 25. A method as claimed in claim 24, furthercomprising transmitting a plurality of additional acoustic wave packetsbetween the two ultrasonic transducers and, excepting a firsttransmission, synchronizing the transmission of all subsequent acousticwave packets to the detection of the arrival of an immediately precedingacoustic wave packet.
 26. A method as claimed in claim 25, whereinsynchronizing the transmission of all subsequent acoustic wave packetsincludes counting a time delay upon transmission of a particularacoustic wave packet and instituting the transmission of a next acousticwave packet after said delay time has elapsed and when said measurementportion corresponding to said particular acoustic wave packet nextcrosses said signal level value.
 27. A method as claimed in claim 24,wherein step (h) further comprises, at the same time the first one oftwo transducers is energized, energizing said second one of twotransducers and outputting an acoustic wave packet for reception by thefirst one of two transducers, detecting the arrival of the acoustic wavepacket at the first one of said transducers, and determining apropagation time of the acoustic wave packet from the second one of saidtransducers.
 28. A method as claimed in claim 27, wherein step (c)further comprises compensating for phase differences between saiddigital signal data converted from analogue signals output fromrespective ones of said transducers.
 29. The method of claim 1, whereinstep (c) comprises converting, at a sampling frequency having a valuebetween 500 kHz and 10 GHz, the analogue signal output from saidtransducer into digital signal data having consequential spacing. 30.The method of claim 1, wherein step (c) comprises converting, at asampling frequency having a value of 10 MHz, the analogue signal outputfrom said transducer into digital signal data having consequentialspacing.
 31. The method of claim 1, wherein step (a) comprisestransmitting an acoustic wave packet at a predetermined frequency havinga value between 20 kHz and 5 MHz.
 32. The method of claim 1, whereinstep (a) comprises transmitting an acoustic wave packet at apredetermined frequency having a value of 125 kHz.
 33. A method ofestimating an arrival time at a transducer of an acoustic wave packettransmitted at a predetermined frequency, said method comprising thesteps of: (a) transmitting an acoustic wave packet at a predeterminedfrequency; (b) detecting at a transducer the acoustic wave packet andproducing an analogue signal; (c) converting an analogue signal outputfrom said transducer into digital signal data; (d) determining aplurality of waveform periods from said digital signal data including awaveform period determined for each of a number of different segments ofsaid analogue signal; (e) averaging the plurality of waveform periodsfor obtaining an average waveform period, and (f) using the averagewaveform period and a corresponding number of waveform periods between adetermined reference point and a point marking a start of the acousticwave packet to estimate an arrival time of the acoustic wave packet bysubtracting from an arrival time of the determined reference point thecorresponding number of waveform periods multiplied by the averagewaveform period.
 34. A method as claimed in claim 33, wherein step (d)comprises determining a plurality of slopes corresponding to transitionsof said analogue signal about a predetermined signal level, and usingsaid slopes to determine the waveform period between adjacent ones ofsaid slopes.
 35. A method as claimed in claim 34, wherein step (d)includes comparing the plurality of slopes with a set of referenceslopes, identifying from the comparison with the set of reference slopesa specific location in said analogue signal, and determining from thespecific location in said analogue signal, using the average waveformperiod, the arrival time.
 36. A method as claimed in claim 35, furthercomprising modifying said set of reference slopes over time, trackingthe changes in said plurality of slopes, and thereby compensating fordeviations from said predetermined frequency at which said acoustic wavepacket is transmitted as detected by said transducer.
 37. A system formeasuring a speed of a moving fluid, said system comprising: ameasurement tube through which the fluid passes; two ultrasonictransducers disposed in said tube and configured for transmittingultrasonic signals between each other; exciting means, coupled to atleast a first one of said transducers, for exciting at least said firstone of said transducers to generate an acoustic wave packet thatpropagates at a predetermined frequency along said tube toward a secondone of said transducers; detecting means connected to at least saidsecond one of said transducers for detecting the acoustic wave packet,converting means, coupled to said detecting means, for converting at asampling frequency an analogue signal output from at least said secondone of said transducers to digital signal data, a first storage meansfor storing said digital signal data from said converting means;processor means connected to said first storage means for determiningthe speed of the fluid, said processor means comprising: firstdetermining means for determining a measurement portion of said digitalsignal data, said measurement portion corresponding to a response ofsaid second one of said transducers to said acoustic wave packet; seconddetermining means for determining from said measurement portion aplurality of slopes S_(i) for a corresponding plurality i of measurementsegments of said response, each of said segments being about a signallevel value V; third determining means for determining from at leastselected ones of said slopes S_(i), an arrival time t of said acousticwave packet.
 38. A system as claimed in claim 37 further comprisingfourth determining means for determining, for selected ones of saidsegments, a corresponding measurement time A_(i) indicative of a time atwhich said response intercepts said signal level value, wherein saidthird determining means determines said arrival time t from saidcorresponding measurement times A_(i).
 39. A system as claimed in claim38, further comprising second storage means connected to said processormeans for storing a reference signal, said processor means includingfifth determining means arranged to match parts of said reference signalwith said measurement portion to determine a measurement position ofeach of the segments in the measurement portion, wherein saidmeasurement times A_(i) are determined using a corresponding one of saidmeasurement positions.
 40. A system as claimed in claim 37, furthercomprising adjusting means, coupled to at least said second one of saidtransducers, for adjusting a magnitude of said analogue signal from atleast said second one of said transducers to fall between certainlimits, said certain limits being equally displaced either side of saidsignal level value, said signal level value preferably being an averageof an output of said second transducer before said measurement portion.41. A system as claimed in claim 37, further comprising altering means,coupled to at least said second one of said transducers, for altering anamplitude of said analogue signal detected by said receiving means suchthat a maximum amplitude of said analogue signal is held substantiallyconstant over a number of received acoustic wave packets.
 42. A systemas claimed in claim 41, wherein said altering means uses a magnitude ofa maximum one of said slopes S_(i) to adjust the amplitude to maintainsaid maximum amplitude substantially constant and thereby said maximumslope within a predetermined range of magnitudes.
 43. The system ofclaim 37, wherein said sampling frequency is between 500 kHz and 10 GHz.44. The system of claim 43, wherein said sampling frequency is 10 MHz.45. The system of claim 44, wherein said predetermined frequency atwhich said acoustic wave packet propagates is between 20 kHz and 5 MHz.46. The system of claim 45, wherein said predetermined frequency atwhich said acoustic wave packet propagates is 125 kHz.